{% extends 'layout.html' %}

{% block page_title %}My Blog Administration{% endblock %}

{% block content %}	
	<h1>My Blog Administration</h1>

	<p><a href="/admin/add">Add Article</a></p>

	{% if articles %}
		<table>
			<thead>
				<tr>
					<th>Title</th>
					<th>Date</th>
					<th>Author</th>
					<th colspan="2">Actions</th>
				</tr>
			</thead>
			<tbody>
			
				{% for article in articles %}
					<tr>
						<td>{{ article.title }}</td>
						<td>{{ article.author }}</td>
						<td>{{ article.timestamp|date('jS F Y') }}</td>
						<td><a href="/admin/edit/{{ article.id }}">Edit</a></td>
						<td><a href="/admin/delete/{{ article.id }}">Delete</a></td>
					</tr>
				{% endfor %}
			</tbody>
		</table>
	{% else %}
		<p>There are currently no articles.</p>
	{% endif %}
{% endblock %}